#include <bits/stdc++.h>
using namespace std;
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using ll = long long;
const ll N = 30;
ll a[N][N];
ll sum;
void check()
{
    ll cnt = 0;
    for (ll i = 0; i < 5;i++)
    {
        for (ll j = 0;j<5;j++)
        {
            if(a[i][j]==0)
                cnt++;
        }
    }
    if(cnt!=13)
    {
        return;
    }
        int count = 0;
    count += a[0][0] + a[1][1] + a[2][2] + a[3][3] + a[4][4];
    if (count % 5 == 0)
        return;
    count = 0;
    count += a[0][4] + a[1][3] + a[2][2] + a[3][1] + a[4][0];
    if (count % 5 == 0)
        return;
    count = 0;
    for (int i = 0; i < 5; i++)
    {
        count += a[i][0] + a[i][1] + a[i][2] + a[i][3] + a[i][4];
        if (count % 5 == 0)
            return;
        count = 0;
        count += a[0][i] + a[1][i] + a[2][i] + a[3][i] + a[4][i];
        if (count % 5 == 0)
            return;
        count = 0;
    }
    sum++;
}
void dfs(ll n)
{
    if (n == 25)
    {
        check();
        return;
    }
    a[n / 5][n % 5] = 0;
    dfs(n + 1);
    a[n / 5][n % 5] = 1;
    dfs(n + 1);
}
void solve()
{
    dfs(0);
}
int main()
{
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
        cout << sum;
    }
    return 0;
}
